<template>
	<view>
		<image class="imgs" mode="widthFix" @click="lookimg()" :src="srcs" v-if="type==1"></image>
		
		<!-- <video id="myVideo" direction="-90" :src="srcs" class="myVideo" v-if="type==2"></video> -->
		<view class="preview-full" v-if="type==2">
			<video id="myVideo" :src="srcs" :show-fullscreen-btn="false" :autoplay="true"></video>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				srcs: '',
				type: 1,
			}
		},
		onReady: function (res) {
		    this.videoContext = uni.createVideoContext('myVideo');
		    this.videoContext.requestFullScreen();
		},
		onLoad(e) {
			this.srcs = e.srcs;
			this.type = e.type;
		},
		onShow() {
			this.API_user()
		},
		methods: {
			lookimg(id) {
				uni.previewImage({
					urls:[this.srcs],
					
				})
			},
			API_user() {
				var that = this;
				that.ran
					.request('/app-api/system/user-model-media/page?pageNo=1&pageSize=10&TYPE=1', {}, 'GET')
					.then(res => {
						console.log(res);
						if (res.code == 200) {
							that.list = res.data.list;
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none'
							});
						}
					});
			},
		}
	}
</script>

<style lang="scss">
	.imgs{
		width: 100vw;
		height: 100vh;
	}
	// .myVideo {
	// 	width: 100vw;
	// }
	.preview-full {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: 100%;
		height: 100%;
		z-index: 1002;
	}
	.preview-full video {
		width: 100%;
		height: 100%;
		z-index: 1002;
	}
</style>